package com.heiqin.Controller;

import com.heiqin.Feign.Service8001;
import com.heiqin.Pojo.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.client.RestTemplate;

import javax.annotation.Resource;
import javax.xml.ws.Service;
import java.util.List;

@RestController
public class TestController {

    private static final String USER_URL = "http://nacos-service-8001";
    @Resource
    private RestTemplate restTemplate;

    @Resource
    Service8001 service8001;

    @GetMapping("/a2")
    public String getAll(){

        return restTemplate.getForObject(USER_URL+"/a1",String.class);
    }

    @GetMapping("/a3")
    public String getALL1(){
        String test = service8001.geta();
        return test;
    }

}
